package com.blackink.controller;

import com.blackink.service.RoleService;
import com.blackink.tool.BaseController;
import com.blackink.tool.CustomResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/role")
public class RoleController extends BaseController {

    @Autowired
    RoleService roleService;

    @RequestMapping(value = "/management")
    public String roleManagement(){
        return "role/rolemanagement";
    }

    @ResponseBody
    @RequestMapping(value = "/list")
    public CustomResult roleList(String roleName, String roleKey, String startTime,String endTime,Integer pageNumber, Integer pageSize){
        System.out.println(1);
        return success(paging(roleService.selectRoleList(roleName,roleKey,startTime,endTime),pageNumber,pageSize));
    }
}
